-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: ensure msg is registered in MsgServiceRouter #628
Conversation
WalkthroughThis update includes various modifications aimed at improving code quality and testing coverage. Key changes involve refining linting conditions in the Makefile, introducing unit tests for the message service router in a new test file, removing lint suppression comments in existing tests, and enhancing the registration logic within the governance module. Overall, the changes contribute to better maintainability, readability, and functionality of the codebase. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Makefile
participant App
participant TestSuite
participant GovModule
User->>Makefile: Run linting
Makefile-->>User: Prompt to check `nolint` comments
User->>App: Create application instance
App->>TestSuite: Run unit tests
TestSuite-->>User: Validate message service router
User->>GovModule: Register services
GovModule-->>User: Confirm service registrations
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
Makefile (1)
147-147
: Discrepancy in the expected count ofnolint
or#nosec
comments.The current count of
nolint
or#nosec
comments is 39, not 43 as expected. Please update the expected count in the Makefile to 39.
- Makefile: Line 147
Analysis chain
Code changes look good.
The modification reflects an update in the codebase that necessitates a revision of the linting criteria. The new expected count of 43 should be verified.
However, ensure that the new expected count of 43 is correct.
Let's sum up the counts of
nolint
or#nosec
comments from the output to verify if the total is 43.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new expected count of `nolint` or `#nosec` comments. # Test: Count the occurrences of `nolint` or `#nosec` comments. Expect: The count should be 43. rg --type go -c 'nolint|#nosec'Length of output: 716
Script:
#!/bin/bash # Description: Sum the counts of `nolint` or `#nosec` comments from the provided output. # Extract the counts from the rg output and sum them up. rg --type go -c 'nolint|#nosec' | awk -F: '{sum += $2} END {print sum}'Length of output: 76
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- Makefile (1 hunks)
- app/app_test.go (1 hunks)
- x/crosschain/keeper/genesis_test.go (1 hunks)
- x/crosschain/keeper/msg_server_test.go (2 hunks)
- x/gov/module.go (1 hunks)
Files skipped from review due to trivial changes (2)
- x/crosschain/keeper/genesis_test.go
- x/crosschain/keeper/msg_server_test.go
Additional comments not posted (3)
app/app_test.go (2)
3-18
: Imports look good.The import statements are appropriate and necessary for the test.
20-43
: Test logic looks good.The test logic is clear and well-structured. It correctly verifies that all non-deprecated message types have a handler registered.
However, ensure that the list of deprecated message types is up-to-date.
Verification successful
The list of deprecated message types is up-to-date.
The search results confirm that the deprecated message types
MsgSetOrchestratorAddress
,MsgAddOracleDeposit
,MsgFxOriginatedTokenClaim
, andMsgUpdateParams
are correctly identified and present in the codebase.
MsgSetOrchestratorAddress
MsgAddOracleDeposit
MsgFxOriginatedTokenClaim
MsgUpdateParams
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the list of deprecated message types. # Test: Search for deprecated message types. Expect: Only occurrences of the listed deprecated types. rg --type go -A 5 $'MsgSetOrchestratorAddress|MsgAddOracleDeposit|MsgFxOriginatedTokenClaim|MsgUpdateParams'Length of output: 97173
x/gov/module.go (1)
102-113
: Code changes look good.The changes enhance the clarity and structure of the registration process. The use of separate variables for
govMsgServer
,msgServer
, andlegacyMsgServer
improves readability.However, ensure that the new registration calls for
types.RegisterMsgServer
andtypes.RegisterQueryServer
are correct.Verification successful
The new registration calls for
types.RegisterMsgServer
andtypes.RegisterQueryServer
are correctly implemented.The occurrences in
x/gov/module.go
match the expected registration calls, confirming their correctness.
types.RegisterMsgServer(cfg.MsgServer(), msgServer)
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new registration calls for `types.RegisterMsgServer` and `types.RegisterQueryServer`. # Test: Search for the registration calls. Expect: Only occurrences of the new registration calls. rg --type go -A 5 $'types.RegisterMsgServer|types.RegisterQueryServer'Length of output: 10083
Summary by CodeRabbit
New Features
Bug Fixes
Tests